﻿@model IEnumerable<DrillOnline.Models.DrillSubject>

@{
    ViewBag.Title = "LoadSenario";
}

<script type="text/javascript">
    $(function () {
        $("#menuol div").click(function () {

            $("#itemol div").hide();
            $("#itemol #sd_" + $(this).attr("id")).fadeIn();
            return false;
        });
    });
</script>

@if (ViewBag.DenyLoad == true)
{ 
    <h2>演练正在进行，不能重新载入。必须先 @Html.ActionLink("停止", "CtrlPanel") 现在演练才能继续。</h2>
    return;
}
<h2>选择载入的演练场景</h2>
<section style="float: left; width: 40%; min-height: 400px">
    <section id="menuol" style="float: right; width: 80%; margin-right: 4px;">

        @foreach (var item in Model)
        {
            <div class="itemlist bg-orange fg-white" id="@(item.ID.ToString("N"))">
                <a href="#">@(item.Title)</a>
            </div>
        }
    </section>
</section>

<section style="float: right; width: 60%; min-height: 400px">
    <section id="itemol" class="bg-white" 
        style="float: left; width: 80%; margin-left: 4px; padding: 0px 12px 0px 12px;">
        @foreach (var item in Model)
        {
            <div style="display:none"  id="sd_@(item.ID.ToString("N"))">
                @using (Html.BeginForm())
                {
                    <p>
                        <h2 class="">@item.Title</h2>
                    </p>
                    
                    
                    <p class="prop">
                        <label>发生时刻</label>@item.StoryBaseTime.ToString("yyyy年MM月dd日HH点mm分")</p>
                    <p class="prop">
                        <label>事件时长</label>@TimeSpan.FromSeconds(item.TotalPlayingSec).ToString()</p>
                    <p class="prop">
                        <label>演练速度</label>1 比 @item.PlayingRate  <i>现实时间和故事时间的比例</i></p>
                    <hr />
                    <p style="text-align: right">
                        @Helpers.Submit("载入")
                    </p>
                    <hr />
                    <pre>@Html.DisplayFor(m => item.Description)
                    </pre>
                    
                    @Html.HiddenFor(m => item.ID)
                    
                }
            </div>
        }

    </section>
</section>
